package com.hx.service;

import com.hx.mappre.UserMapper;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Data
public class UserService4 {
    @Value(value = "彬")
    private String name;
    //根据类型注入UserDao
    @Resource(type = UserMapper.class)
    private UserMapper userMapper;
    //定义尘缘方法
    public void add(){
        System.out.println("添加成功！！");
        //调用持久层方法
        userMapper.insert();
    }
}
